package com.jf.push;

import android.app.Application;

import com.jf.jpush_lib.BuildConfig;

import cn.jiguang.share.android.api.JShareInterface;
import cn.jiguang.share.android.api.PlatformConfig;
import cn.jpush.android.api.JPushInterface;

/**
 * 初始化推送，建议放在Application里面
 * <p>
 * Created by liuyakui on 2020-02-10.
 */
public class PushInit {

    public static void init(Application application) {
        try {
            JShareInterface.setDebugMode(BuildConfig.DEBUG);
            JPushInterface.setDebugMode(BuildConfig.DEBUG);
            JPushInterface.init(application);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void initShare(Application application, String appId, String appSecret){
        PlatformConfig platformConfig = new PlatformConfig().setWechat(appId, appSecret);
        JShareInterface.init(application, platformConfig);
    }
}
